package org.sy.lab.多线程基础._2_同步._1_synchronized._1_锁的对象;

public class Tick2 implements ITick {
	
	private int num = 100;
	
	@Override
	public void add() {
		synchronized(ITick.class) {
			num++;
		}
	}
	
	@Override
	public void subtract() {
		synchronized(ITick.class) {
			num--;
		}
	}
	
	@Override
	public int getNum() {
		return num;
	}
}
